<template>
  <div id="index">
    <nav>
      <router-link tag="div" to="/">推荐音乐</router-link>
      <router-link tag="div" to="/remen">热歌榜</router-link>
      <router-link tag="div" to="/tuijian">搜索</router-link>
    </nav>

    <keep-alive :exclude="['BoFangQi']">
      <!-- <transition name="slide" mode="out-in"> -->
        <router-view @AudioId="$emit('playAudioId', $event)" :AudioplaysongId="AudioplaysongId" :playing="playing"
          @playsong="$emit('playsong')" @pauessong="$emit('pauessong')" @nextsong="$emit('nextsong')"
          @Previoussong="$emit('Previoussong')" @changeSongTime="$emit('changeSongTime', $event)" :songlist="songlist"  @delsong="$emit('delsong',$event)" @addsonglist="$emit('addsonglist',$event)" />
      <!-- </transition> -->
    </keep-alive>
  </div>
</template>

<script>


export default {
  props: {
    AudioplaysongId: Number,
    song: Object,
    playing: Boolean,
    songlist: Array
  },
};
</script>

<style lang="less" scoped>
@keyframes slide-in {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0);
  }
}

@keyframes slide-out {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-100%);
  }
}

html::-webkit-scrollbar {
  width: 0;
  height: 0;
  scrollbar-width: none;
}

body::-webkit-scrollbar {
  width: 0;
  height: 0;
  scrollbar-width: none;
}

#index {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  // text-align: center;
  color: #2c3e50;
  margin-bottom: 80px;
}

/* 进入路由的动画 */
.slide-enter-active {
  animation: slide-in 0.2s;
}

.slide-leave-active {
  animation: slide-out 0.2s;
}

.slide-enter,
.slide-leave-to

/* .slide-leave-active in <2.1.8 */
  {
  transform: translateX(100%);
}


nav {
  display: flex;
  justify-content: space-around;
  align-items: center;
  margin-bottom: 10px;
  height: 40px;
  box-sizing: border-box;

  div {
    display: flex;
    align-items: center;
    height: 38px;
    font-weight: bold;
    color: #2c3e50;
    box-sizing: border-box;

    &.router-link-exact-active {
      box-sizing: border-box;

      color: #d43c33;
      border-bottom: 2px solid #d43c33;
    }
  }
}
</style>